
/*interface shape{
    // 抽象方法
    public abstract void method1(); // public abstract 是固定搭配，可以不写
    public void method2();
    abstract void method3();
    void method4();
}
// 注意：在接口中上述写法都是抽象方法，推荐第四种方式，代码更简洁*/


interface ITest {
   static public void testStatic(){
       System.out.println("testStatic()");
   }
   default public void testDefault(){
       System.out.println("testDefault()");
   }
}

class TestDemo implements ITest {
    public void testDefault(){
        System.out.println("重写testDefault()");
    }
}
/*

public class Test {
    public static void main(String[] args) {
        ITest.testStatic();//直接通过接口名访问static修饰的方法

        TestDemo testDemo = new TestDemo();
        testDemo.testDefault();//实例化TestDemo对象才能访问default修饰的方法
    }
}
*/




/*

interface Shape {
    void draw();
}

class Rect implements Shape {
    @Override
    public void draw() {
        System.out.println("🔶🔶🔶");
    }
}

class Flower implements Shape {
    @Override
    public void draw() {
        System.out.println("❀❀❀");
    }
}

public class Test {
    public static void drawMap(Shape shape) {
        shape.draw();
    }
    public static void main(String[] args) {
        Shape[] shapes = {new Rect(), new Flower(), new Rect(), new Flower()};
        for (Shape shape : shapes) {
            shape.draw();
        }
    }
}

*/


interface A {
    void testA();
}
interface B extends A {
    void testB();
}
class TestDome implements B {
    @Override
    public void testA() {

    }
    @Override
    public void testB() {

    }
}














